package com.qrpay.model.enums;

public enum FeeType {

    Rate("rate", "手续费按每笔费率"),
    Vip("vip", "会员免收手续费"),
    RateAndFixed("rateAndFixed", "比例加固定金额算费"),
    ;

    private final String code;
    private final String desc;

    FeeType(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public boolean equals(String code) {
        return this.code.equals(code);
    }

    public static FeeType byCode(String code) {
        for (FeeType t : values()) {
            if (t.equals(code)) return t;
        }
        return null;
    }
}
